package com.atguigu.lease.common.context;

/**
 * @ClassName LoginUserContext
 * @Author admin
 * @Date 2024/6/4
 */
public class LoginUserContext {

    private static final ThreadLocal<LoginUser> USER_THREAD_LOCAL = new ThreadLocal<>();

    public static LoginUser getLoginUser(){
        return USER_THREAD_LOCAL.get();
    }

    public static void setLoginUser(LoginUser loginUser){
        USER_THREAD_LOCAL.set(loginUser);
    }

    public static void clear(){
        USER_THREAD_LOCAL.remove();
    }

}
